<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../../css/mui.min.css" rel="stylesheet" />
		<style type="text/css">
			/*#count {
				display: none;
			}*/
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-back  mui-icon-backmui-pull-left"></a>
			<h1 class="mui-title">绑定</h1>
		</header>

		<div class="mui-content">
			<div class="mui-content-padded">
				<form class="mui-input-group" style="margin: 5px;">
					<div class="mui-input-row">
						<label>输入验证码</label>
						<input type="text" class="mui-input-clear" placeholder="请输入验证码">
					</div>
					<div class="mui-button-row" style="height: 65px;">
						<button type="button" class="mui-btn mui-btn-primary mui-btn-block">
							<span>提交验证码</span>
						</button>
					</div>
				</form>
				<div style="margin: 5px;">
					<h4>说明：</h4>
					<p>
						发送给您的验证码有效期只用3分钟，过期请点击重新发送
					</p>
				</div>
				<div style="text-align: right;">
					<button id="renew"><span id="count">重新发送</span></button>
					<!--<button id="count">重新发送</button>-->
				</div>
			</div>
		</div>
		<script src="../../../js/mui.min.js"></script>
		<script type="text/javascript">
			mui.init({
				swipeBack: true //启用右滑关闭功能
			})
			var flag = true;
			document.getElementById("renew").addEventListener('tap', function() {
				if(flag) {
					var count = 120;
					var timer1 = setInterval(function() {
						if(count <= 0) {
							flag = true;
							document.getElementById("count").innerHTML = "重新发送";
							//执行发送逻辑
							window.clearInterval(timer1);
						} else {
							flag = false;
							count = count - 1;
							document.getElementById("count").innerHTML = count + "s后发送重新";
						}
					}, 1000);
				}
				
			});
		</script>
	</body>

</html>